<?php
/**
* author: NickBai
* createTime: 2017/2/6 0006 上午 9:03
*/
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Gregwar\Captcha\CaptchaBuilder;
class IndexController extends Controller
{
    public function index()
    {
         return view('admin.index.index');
    }
    //获取验证码
//    public function code()
//    {
//        $code = new \Code();
//        $code->make();
//    }
    public function code()
    {
        $captcha = new CaptchaBuilder;
        $captcha->build();
        // session('phrase',$captcha->getPhrase());
        \Session::set('phrase',$captcha->getPhrase());//注意不能使用session()
        //dd($captcha->build()) ;
        return response($captcha->output())->header('Content-type','image/jpeg');
    }
}